package com.arg.friday.dao;

import com.arg.friday.entity.Dog;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@Data
@Component
public class MockDatabase {
    @Value("${my.conf:true}")
    private Boolean flag;
    @Value("${my.set}")
    private String hello;
    @Resource
    private Random random;

    private List<Dog> dogs = new ArrayList<>();

    @PostConstruct
    public void mount(){
        dogs.add(new Dog(){{
            setAge(1);
            setColour(Colour.blue);
            setId((random.nextInt(8999)+1000)+"");
        }});
        dogs.add(new Dog(){{
            setAge(2);
            setColour(Colour.green);
            setId((random.nextInt(8999)+1000)+"");
        }});
        dogs.add(new Dog(){{
            setAge(3);
            setColour(Colour.yellow);
            setId((random.nextInt(8999)+1000)+"");
        }});

    }

}
